import java.util.ArrayList;

public class Test1 {
    static void main() {
        ArrayList<Student> list = new ArrayList<>();

        Student s1 = new Student("陈平安",17);
        Student s2 = new Student("刘灞桥",18);
        Student s3 = new Student("宁姚",16);


        list.add(s1);
        list.add(s2);
        list.add(s3);

    for (int i = 0;i<list.size();i++) {
        Student stu = list.get(i);
        System.out.println(stu.getName()+","+stu.getAge());
       }
    }
}
